package ru.aslanov.schedule.model;

import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlID;

/**
 * Created by IntelliJ IDEA.
 * Created: Feb 27, 2010 3:57:35 PM
 *
 * @author Sergey Aslanov
 */
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class GCalendar extends Entity {
    @Persistent
    private String calendarId;
    @Persistent
    private String name;    
    @Persistent
    private String id;

    @Persistent
    private Schedule schedule;    

    @XmlAttribute
    public String getCalendarId() {
        return calendarId;
    }

    public void setCalendarId(String calendarId) {
        this.calendarId = calendarId;
    }

    @XmlAttribute
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Schedule getSchedule() {
        return schedule;
    }

    @XmlID
    @XmlAttribute
    public String getId() {
        return id != null ? id : getLocalId();
    }

    public void setId(String id) {
        this.id = id;
    }
}
